package com.xiaoran.rabbitmq.demo.consumer;


import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j;

import org.springframework.amqp.core.Message;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;



//队列TTL消费者
@Slf4j
@Component
public class DeadTTLQueueConsumer {
    //接收消息
    @RabbitListener(queues = "QD")
    public void receiveD(Message message, Channel channel){
        System.out.println("--------------------------------------");
            String msg=new String (message.getBody());
            System.out.println("当前的时间收到死信队列的消息:"+msg);
    }

}
